from django.db import models


# Create nurse models here.


class NurseInfo(models.Model):

    id = models.AutoField(primary_key=True)
    name = models.CharField('姓名', max_length=20, null=False, blank=False, unique=True)
    phone = models.CharField('电话', max_length=11, null=False, blank=False, unique=True)
    password = models.CharField('密码', max_length=256, null=False, blank=False)
    authority = models.IntegerField('权限', default=0, null=False)
    create_time = models.DateTimeField('创建时间', auto_now_add=True)
    total_count = models.IntegerField('做题总数', default=0)
    correct_count = models.IntegerField('正确题数', default=0)

    class Meta:
        db_table = 't_nurse'
        verbose_name = '用户表'
        verbose_name_plural = verbose_name
        ordering = ['id']

    def __str__(self):
        return self.name
